package edu.hnu.productserver.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import edu.hnu.productserver.entity.Stocks;
import edu.hnu.productserver.service.StocksService;
import edu.hnu.productserver.mapper.StocksMapper;
import edu.hnu.commonutils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;


@Service
public class StocksServiceImpl extends ServiceImpl<StocksMapper, Stocks>
    implements StocksService {

    @Autowired
    StocksMapper stocksMapper;

    public Result  stocksInfo(){
        System.out.println("getStocksInfo");
        QueryWrapper<Stocks> queryWrapper = new QueryWrapper<>();
        queryWrapper.like("ticker","%");
        List<Stocks> stocksList = stocksMapper.selectList(queryWrapper);
        return Result.ok().data(stocksList);
    }
}




